<template>
  <div class="container">
    <Category title="美食">
      <img
        slot="center"
        src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Flmg.jj20.com%2Fup%2Fallimg%2F1114%2F121R0113012%2F20121Q13012-9-1200.jpg&refer=http%3A%2F%2Flmg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1670415975&t=629f2b4b4d8e63e9c7af1c475a7e6ed6"
      />
      <a href="http://www.baidu.com" slot="footer">更多美食</a>
    </Category>
    <Category title="游戏">
      <ul slot="center">
        <li v-for="(game, index) in games" :key="index">{{ game }}</li>
      </ul>
      <div class="foot" slot="footer">
        <a href="http://www.baidu.com">单击游戏</a>
        <a href="http://www.baidu.com">网络游戏</a>
      </div>
    </Category>
    <Category title="电影">
      <video
        slot="center"
        controls
        src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
      ></video>
      <!-- template与v-slot搭配使用 -->
      <template v-slot:footer>
        <div class="foot">
          <a href="http://www.baidu.com">热门</a>
          <a href="http://www.baidu.com">经典</a>
          <a href="http://www.baidu.com">推荐</a>
        </div>
        <h4>欢迎前来观影</h4>
      </template>
    </Category>
  </div>
</template>

<script>
import Category from './components/Category.vue'

export default {
  name: 'App',
  components: {
    Category,
  },
  data() {
    return {
      foods: ['烧烤', '火锅', '炒菜', '蛋糕'],
      games: ['红警', '使命召唤', '战地'],
      films: ['《人世间》', '《红海行动》', '《教父》', '《寄生虫》'],
    }
  },
}
</script>

<style>
.container,
.foot {
  display: flex;
  justify-content: space-around;
  text-align: center;
}
img {
  width: 100%;
}
video {
  width: 100%;
}
</style>
